package com.yida.gwj.config.service.impl;

import com.yida.common.core.utils.StringUtils;
import com.yida.gwj.config.domain.request.GwjBusinessHouseUseTypeRequest;
import com.yida.gwj.config.mapper.GwjBusinessTypeMapper;
import com.yida.gwj.config.service.IGwjBusinessTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 业务查询类型专用service业务层处理
 *
 * @author lqq
 * @date 2022-12-21
 */
@Service
public class GwjBusinessTypeServiceImpl implements IGwjBusinessTypeService {

	@Resource
	private GwjBusinessTypeMapper gwjBusinessTypeMapper;

	/**
	 * 查询房屋的规划用户
	 *
	 * @param gwjBusinessHouseUseTypeRequest 业务房屋规划用途查询请求
	 * @return 类型集合
	 */
	@Override
	public List<String> selectHouseUseType(GwjBusinessHouseUseTypeRequest gwjBusinessHouseUseTypeRequest) {
		List<String> useTypeList = gwjBusinessTypeMapper.selectHouseUseType(gwjBusinessHouseUseTypeRequest);
		if (StringUtils.isEmpty(useTypeList)) {
			useTypeList = new ArrayList<>();
		}
		useTypeList.add(0, "全部");
		return useTypeList;
	}
}
